from socket import socket

s = socket()
s.bind(("localhost", 9999))
s.listen(3)
while True:
    conn, addr = s.accept()
    data = conn.recv(1024).decode()
    print("客户端发来的信息：\n", addr, data)

    conn.send("HTTP/1.1 200 ok\nlala:lala\ncontent-type:text/html\n\n<h1>hello world</h>".encode())
    conn.close()
